package gridmapper;

public final class RobotHeading {

	public final static int NORTH = 360;
	public final static int EAST = 90;
	public final static int SOUTH = 180;
	public final static int WEST = 270;
	public final static int WAIT = -1;
	public final static int INVALID = Integer.MIN_VALUE;

	public final static int parseRobotHeadings(String heading) {
		if (heading.equalsIgnoreCase("NORTH"))
			return NORTH;
		if (heading.equalsIgnoreCase("EAST"))
			return EAST;
		if (heading.equalsIgnoreCase("SOUTH"))
			return SOUTH;
		if (heading.equalsIgnoreCase("WEST"))
			return WEST;
		if (heading.equalsIgnoreCase("WAIT"))
			return WAIT;
		return INVALID;
	}

	public static String toString(int heading) {
		if (heading == NORTH)
			return "NORTH";
		if (heading == EAST)
			return "EAST";
		if (heading == SOUTH)
			return "SOUTH";
		if (heading == WEST)
			return "WEST";
		if (heading == WAIT)
			return "WAIT";
		return "INVALID";
	}
}